<?php
defined('IN_IA') or exit('Access Denied');
global $_W, $_GPC;
if ($_W['ispost']) {
	$uniacid = $_W['uniacid'];
	$quan_link = $_GPC['quan_link'];
	$id = $_GPC['id'];
	$url = $quan_link;
	$ch = curl_init();
	$timeout = 10;
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257 QQ/5.2.1.302 NetType/WIFI Mem/28");
	$html = curl_exec($ch);
	curl_close($ch);
	if ($html) {
		$uls = $this->getTags($html, "div class=\"sale-info\"");
		if (!isset($uls[0]['s'])) {
			exit(json_encode(array('status' => 500)));
		}
		$content = substr($html, $uls[0]['s'], $uls[0]['e']);
		if (strpos($content, "不存在") > 0) {
			$data = array();
			$data['status'] = 0;
			pdo_update($this->tableitemall, $data, array('id' => $id));
			exit(json_encode(array('status' => 1)));
		} else {
			exit(json_encode(array('status' => 0)));
		}
	} else {
		exit(json_encode(array('status' => 500)));
	}
}